﻿using System;
using System.Collections.Generic;
using NHibernate;
using OrderCreator.NHibernate.DataModel.Domain;

namespace OrderCreator.NHibernate.DataModel.Repositories
{
    public class CategoryRepository : ICategoryRepository
    {
        #region Implementation of ICategoryRepository

        public void Add(Category category)
        {
            using (ISession session = NHibernateHelper.OpenSession())
            {
                using (ITransaction transaction = session.BeginTransaction())
                {
                    session.Save(category);
                    transaction.Commit();
                }
            }
        }

        public void Update(Category product)
        {
            throw new NotImplementedException();
        }

        public void Remove(Category product)
        {
            throw new NotImplementedException();
        }

        public Category GetCategoryById(Guid id)
        {
            throw new NotImplementedException();
        }

        public IList<Category> GetAllCategories()
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
